package com.app.view;




import android.content.Context;
import android.graphics.Canvas;
import android.util.AttributeSet;
import android.widget.ImageView;

/**
 * 触感反馈，如果设置可点击，则点击后变暗
 *
 */
public class FilterImageView extends ImageView {
	public FilterImageView(Context context) {
		super(context);
	}

	public FilterImageView(Context context, AttributeSet attrs) {
		super(context, attrs);
	}

	@Override
	protected void onDraw(Canvas canvas) {
		super.onDraw(canvas);

		if (isPressed()&&isClickable())
			canvas.drawColor(0x33000000);
	}

	@Override
	protected void dispatchSetPressed(boolean pressed) {
		super.dispatchSetPressed(pressed);
		invalidate();
	}
}
